package com.finiac.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

@Entity
@Proxy(lazy=false)
@Table(name="sales")
public class Sales {
	private long id;
	private Product productId;
	private float qtySold;
	private float total;
	private Bill billId;
	private int isActive;
	@Id
	@GeneratedValue
	@Column(name="id")
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	
	@ManyToOne
	@JoinColumn(name="product_id")
	public Product getProductId() {
		return productId;
	}
	public void setProductId(Product productId) {
		this.productId = productId;
	}
	@Column(name="qty_sold")
	public float getQtySold() {
		return qtySold;
	}
	
	public void setQtySold(float qtySold) {
		this.qtySold = qtySold;
	}
	@Column(name="total")
	public float getTotal() {
		return total;
	}
	public void setTotal(float total) {
		this.total = total;
	}
	@ManyToOne
	@JoinColumn(name="bill_id")
	public Bill getBillId() {
		return billId;
	}
	public void setBillId(Bill billId) {
		this.billId = billId;
	}
	
	@Column(name="is_active")
	public int getIsActive() {
		return isActive;
	}
	public void setIsActive(int isActive) {
		this.isActive = isActive;
	}
	public Sales(Product productId, float qtySold, float total, Bill billId , int isActive) {
		this.productId = productId;
		this.qtySold = qtySold;
		this.total = total;
		this.billId = billId;
		this.isActive=isActive;
	}
	public Sales(){}
	
	
}
